<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=d, initial-scale=1.0">
    <title>输出100以内的所有质数</title>
    <script>
        function findPrimeNumbers() {
            var primeNumbers = [];
        
            for (var n = 2; n <= 100; n++) {
                var isPrime = true;
                for (var m = 2; m < n; m++) {
                    if (n % m === 0) {
                        isPrime = false;
                        break;
                    }
                }
                if (isPrime) {
                    primeNumbers.push(n);
                }
            }
        
            alert("100以内的所有质数：" + primeNumbers.join(", "));
        }
        </script>
        </head>
        <body>
        <button onclick="findPrimeNumbers()">查找质数</button>
        </body>
        </html>